package unit3.test;

import java.util.Scanner;

public class HuiWen {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int num = scanner.nextInt();

        int n = 0, reverse = 0, copy = num;
        do {
            n++;
            reverse = reverse * 10 + num % 10;
            num = num / 10;
        } while (num != 0);
        System.out.println(n);
        System.out.println(reverse == copy ? "Y" : "N");
    }
}
